﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common
{
   public  class Record : Item
    {
       public int ID { get; set; }
       //Назва запису за класифікатором
       public string TypeRecord { get; set; }
       //Номер запису
       public string NumRecord { get; set; }
       //Початкова вартість
       public string InitialCost { get; set; }
       //Номер рахунка
       public string Accounts { get; set; }
       //Інвентарний номер
       public string InvNum { get; set; }
       //Прийняв
       public string AdoptedRecord { get; set; }
       //Здав
       public string PassedRecord { get; set; }
       //
       public string ScanDoc { get; set; }
       //
       public string WorldExcelDoc { get; set; }
       //
       public string FileExsten { get; set; }

       public Dictionary<string, string> ItemFields { get; private set; }
       public Dictionary<string, string> AccountFields { get; private set; }
       public Dictionary<string, string> EmployeFields { get; private set; }
       public Dictionary<string, string> RefRecordFields { get; private set; }
       public Dictionary<string, string> RecordFields { get; private set; }

       public Record() { }

       public Record(string name, string publisher, DateTime publishedDate, string typeRecord, string numRecord, string initialCost, string accounts, string invNum, string aportedRecord, string passedRecord)
           : this(0, name, publisher, publishedDate, typeRecord, numRecord, initialCost, accounts, invNum, aportedRecord, passedRecord) { }
        public Record(int id, string name, string publisher, DateTime publishedDate, string typeRecord, string numRecord, string initialCost, string accounts, string invNum, string aportedRecord, string passedRecord)
       {
            this.ID = id;
            this.Name = name;
            this.Publisher = publisher;
            this.PublishedDate = publishedDate;
            this.TypeRecord = typeRecord;
            this.NumRecord = numRecord;
            this.InitialCost = initialCost;
            this.Accounts = accounts;
            this.InvNum = invNum;
            this.AdoptedRecord = aportedRecord;
            this.PassedRecord = passedRecord;

            ItemFields = new Dictionary<string, string>(3);
            ItemFields.Add("Name",Name);
            ItemFields.Add("Publisher", Publisher);
            ItemFields.Add("PublishedDate", PublishedDate.Date.ToString());

            AccountFields = new Dictionary<string, string>(1);
            AccountFields.Add("Name", Accounts);

            EmployeFields = new Dictionary<string, string>(2);
            EmployeFields.Add("AdoptedRecord", AdoptedRecord);
            EmployeFields.Add("PassedRecord", PassedRecord);

            RefRecordFields = new Dictionary<string, string>(1);
            RefRecordFields.Add("TypeRecord", TypeRecord);

            RecordFields = new Dictionary<string, string>(3);
            RecordFields.Add("NumRecord", NumRecord);
            RecordFields.Add("InitialCost", InitialCost);
            RecordFields.Add("InvNum", InvNum);



       }

    }
}
